//package com.easyto.filter;
//
//import com.google.common.collect.Lists;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletRequestWrapper;
//import java.util.ArrayList;
//import java.util.Collections;
//import java.util.Enumeration;
//import java.util.List;
//
//public class HttpServletWrapper extends HttpServletRequestWrapper {
//
//    public HttpServletWrapper(HttpServletRequest request) {
//        super(request);
//    }
//
//
//    @Override
//    public Enumeration<String> getHeaders(String name) {
//        List<String> allHeaders = new ArrayList<>();
//
//        // 添加原始请求头
//        Enumeration<String> originalHeaders = super.getHeaders(name);
//        if (originalHeaders != null) {
//            while (originalHeaders.hasMoreElements()) {
//                allHeaders.add(originalHeaders.nextElement());
//            }
//        }
//
//        // 添加自定义请求头
//        if ("uname".equals(name)) {
//            String userName = "zhangsan";
//            ArrayList<String> names = Lists.newArrayList(userName, "lisi");
//            allHeaders.addAll(names);
//        }
//        return Collections.enumeration(allHeaders);
//    }
//}
